package com.liy.cloud.common.feign.fallback;

import com.liy.cloud.common.feign.api.PwFeignClient;
import com.das.framework.common.extvo.ResultVO;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author libs
 * @ClassName PwFeignClientFallbackFactory
 * @Description
 * @date 2019/9/26 21:50:23
 */
@Component
public class PwFeignClientFallbackFactory implements FallbackFactory<PwFeignClient> {
    @Override
    public PwFeignClient create(Throwable e) {
        return new PwFeignClient() {

            @Override
            public ResultVO addSellerReport(String sellerId) {
                return new ResultVO(false, "调用添加售票员结算单接口时发生错误：" + e.getMessage());
            }
        };
    }
}
